package com.hulk.ratel.persistence.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.hulk.ratel.persistence.entity.SuperEntity;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author hulk
 * @since 2021-03-13
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_log_txn_pay_record")
public class LogTxnPayRecord extends SuperEntity<LogTxnPayRecord> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @TableField("int_cut_date")
    private String intCutDate;

    /**
     * 此id报文头返回给合作方， 同时发送给支付机构作为流水号，同时在平台内部作为唯一的日志跟踪号，最终作为本表的唯一id标识号。
     */
    @TableField("work_id")
    private Long workId;

    @TableField("merchant_code")
    private String merchantCode;

    /**
     * plat_merchant_code与相同
     */
    @TableField("org_merchant_code")
    private String orgMerchantCode;

    /**
     * 内部分配的支付机构号 对应org_partner_no
            
     */
    @TableField("org_code")
    private String orgCode;

    @TableField("partner_no")
    private String partnerNo;

    @TableField("district_code")
    private String districtCode;

    @TableField("city_code")
    private String cityCode;

    @TableField("province_code")
    private String provinceCode;

    @TableField("lbs")
    private String lbs;

    @TableField("os")
    private String os;

    @TableField("client_ip")
    private String clientIp;

    @TableField("imei")
    private String imei;

    @TableField("device_id")
    private String deviceId;

    @TableField("mobile")
    private String mobile;

    @TableField("trace_id")
    private String traceId;

    @TableField("txn_type")
    private String txnType;

    @TableField("txn_code")
    private String txnCode;

    @TableField("req_time")
    private String reqTime;

    @TableField("subject")
    private String subject;

    @TableField("description")
    private String description;

    @TableField("shop_code")
    private String shopCode;

    @TableField("goods_tag")
    private String goodsTag;

    @TableField("expire_time")
    private Integer expireTime;

    @TableField("qr_code")
    private String qrCode;

    @TableField("pay_scene")
    private String payScene;

    @TableField("uuid")
    private String uuid;

    @TableField("auth_code")
    private String authCode;

    @TableField("source_id")
    private String sourceId;

    /**
     * 刷单交易 SCALP 正常交易 NORMAL
     */
    @TableField("buss_type")
    private String bussType;

    /**
     * (支付机构异步通知)贷：C  借 ：D 其他 ：O
     */
    @TableField("dcredit_flag")
    private String dcreditFlag;

    @TableField("total_amt")
    private Integer totalAmt;

    @TableField("buyer_pay_amt")
    private Integer buyerPayAmt;

    @TableField("favor_amt")
    private Integer favorAmt;

    @TableField("point")
    private Integer point;

    @TableField("call_back_url")
    private String callBackUrl;

    @TableField("resp_time")
    private String respTime;

    @TableField("resp_code")
    private String respCode;

    @TableField("resp_msg")
    private String respMsg;

    @TableField("async_version")
    private String asyncVersion;

    @TableField("async_txn_code")
    private String asyncTxnCode;

    @TableField("async_trace_id")
    private String asyncTraceId;

    @TableField("async_ori_trace_id")
    private String asyncOriTraceId;

    /**
     * trace_id与相同
     */
    @TableField("async_work_id")
    private String asyncWorkId;

    @TableField("async_resp_code")
    private String asyncRespCode;

    @TableField("async_resp_msg")
    private String asyncRespMsg;

    @TableField("async_resp_time")
    private String asyncRespTime;

    /**
     * 01-受理请求插入流水
            02-向支付机构发送请求等待支付机构响应
            03-收到支付机构同步响应
            04-收到支付机构回调响应
            05-返回前端商户同步交易完成
            06-返回前端商户回调交易完成
            
     */
    @TableField("step")
    private String step;

    /**
     * TIMEOUT-超时
            PROCESSING-处理中
            UNPAY-待支付
            INIT-初始
            SUCCESS
	        FAILED-失败
            
     */
    @TableField("status")
    private String status;

    @TableField("org_acct_date")
    private String orgAcctDate;

    @TableField("org_version")
    private String orgVersion;

    @TableField("org_partner_no")
    private String orgPartnerNo;

    @TableField("org_trace_id")
    private String orgTraceId;

    @TableField("org_resp_seq_id")
    private String orgRespSeqId;

    @TableField("org_clear_flag")
    private String orgClearFlag;

    @TableField("org_pay_time")
    private String orgPayTime;

    @TableField("org_req_time")
    private String orgReqTime;

    @TableField("org_resp_time")
    private String orgRespTime;

    @TableField("org_resp_flag")
    private String orgRespFlag;

    @TableField("org_resp_code")
    private String orgRespCode;

    @TableField("org_resp_msg")
    private String orgRespMsg;

    @TableField("org_async_trace_id")
    private String orgAsyncTraceId;

    @TableField("org_async_ori_trace_id")
    private String orgAsyncOriTraceId;

    /**
     * trace_id与相同
     */
    @TableField("org_async_work_id")
    private String orgAsyncWorkId;

    @TableField("org_async_resp_flag")
    private String orgAsyncRespFlag;

    @TableField("org_async_resp_code")
    private String orgAsyncRespCode;

    @TableField("org_async_resp_msg")
    private String orgAsyncRespMsg;

    @TableField("org_async_resp_time")
    private String orgAsyncRespTime;

    @TableField("org_async_status")
    private String orgAsyncStatus;

    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedTime;

    @TableField("ori_id")
    private String oriId;

    @TableField("tenant_id")
    private String tenantId;

    @TableField("rsv1")
    private String rsv1;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
